package icu.minxin.tree23;

/**
 * @ClassName: Tree23
 * @Author AbelEthan
 * @Email AbelEthan@126.com
 * @Date 2021/6/4 下午4:22
 * @Description
 */
public class Tree23 {
    private Tree23Node root;

    public Tree23() {
    }

    public Tree23Node find(Integer data) {
        Tree23Node current = root;
        if (current == null) {
            return null;
        }
        while (true) {
            Integer count = current.getCount();
            for (int i = 0; i < count; i++) {
                if (current.getData()[i] == null) {
                    break;
                } else if (current.getData()[i].equals(data)) {
                    return current;
                }
                current = root.getChildrenNodes()[i];
            }
        }
    }
}
